import { createRouter, createWebHistory } from "vue-router";
import HomeView from "@/views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      component: HomeView,
    },
    {
      path: "/about",
      name: "about",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("@/views/AboutView.vue"),
    },
    {
      path: "/book",
      name: "book",
      component: () => import("@/views/BookView.vue"),
    },
    {
      path: "/chat",
      name: "chat",
      component: () => import("@/views/ChatView.vue"),
    },

    {
      path: "/nlp",
      name: "nlp",
      component: () => import("@/views/NLPView.vue"),
    },

    {
      path: "/iframe",
      name: "iframe",
      component: () => import("@/views/IFrameView.vue"),
    },
    {
      path: "/blog",
      name: "blog",
      component: () => import("@/views/BlogView.vue"),
    },
    {
      path: "/blog/detail/:id",
      name: "blogDetail",
      component: () => import("@/views/BlogDetail.vue"),
    },
    {
      path: "/blog/edit",
      name: "blogEdit",
      component: () => import("@/views/BlogEdit.vue"),
    },
    {
      path: "/edit",
      name: "blogEditDetail",
      component: () => import("@/views/EditView.vue"),
    },

    {
      path: "/trigger",
      name: "trigger",
      component: () => import("@/views/TriggerView.vue"),
    },

    {
      path: "/menu",
      name: "menu",
      component: () => import("@/views/MenuView.vue"),
      children: [
        {
          path: "dashboard",
          name: "menuDashboard",
          component: () => import("@/views/MenuContent/DashboardView.vue"),
        },
        {
          path: "content1",
          name: "menuContent1",
          component: () => import("@/views/MenuContent/ContentView1.vue"),
        },
        {
          path: "content2",
          name: "menuContent2",
          component: () => import("@/views/MenuContent/ContentView2.vue"),
        },
        {
          path: "content3",
          name: "menuContent3",
          component: () => import("@/views/MenuContent/ContentView3.vue"),
        },
      ],
    },
    {
      path: "/chat-agent",
      name: "chat-agent",
      component: () => import("@/views/ChatAgent.vue"),
    },
    {
      path: "/game",
      name: "game",
      component: () => import("@/views/GameView.vue"),
    },
    {
      path: "/epub",
      name: "epub",
      component: () => import("@/views/EpubView.vue"),
    },
    {
      path: "/db",
      name: "db",
      component: () => import("@/views/DBView.vue"),
    },
    {
      path: "/web3d",
      name: "web3d",
      component: () => import("@/views/Web3D.vue"),
    },
    {
      path: "/echart",
      name: "echart",
      component: () => import("@/views/EchartView.vue"),
    },
  ],
});

export default router;
